# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Douglas Soares de Andrade <douglas@archlinux.org>

pkgname=glade
pkgver=3.20.0+27+g2b88ce24
pkgrel=1
pkgdesc="User interface builder for GTK+ and GNOME."
arch=(i686 x86_64)
license=(GPL LGPL)
depends=(gtk3 libxml2)
makedepends=(intltool gtk-doc gobject-introspection python-gobject itstool docbook-xsl git
             gnome-common)
optdepends=('python: Python widgets support'
            'devhelp: help browser')
url="https://glade.gnome.org/"
_commit=2b88ce24e32e8377dfbf2a5e4852c29725da7dbb  # glade-3-20
source=("git+https://git.gnome.org/browse/glade#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^GLADE_//;s/_/./g;s/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --disable-static --enable-gtk-doc
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
